package com.book.service;

import com.book.dao.bookDao;
import com.book.po.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class bookService {

    @Autowired
    private bookDao bookDao;

    public List<Book> book_select(Book book){
        return bookDao.book_select(book);
    };

    public String book_insert(Book book){
        if (bookDao.book_insert(book)!=0){
            return "添加成功";
        }else {
            return "添加失败";
        }
    };

    public String book_delete(Integer bookId){
        if (bookDao.book_delete(bookId)!=0){
            return "删除成功";
        }else {
            return "删除失败";
        }
    }

    public String book_update(Book book){
        if (bookDao.book_update(book)!=0){
            return "修改成功";
        }else {
            return "修改失败";
        }
    }
}
